'use strict';
var fs = require('fs');

/*
 * Helper function to read files from file-system. 
 */
function readJsonFileSync(filepath, encoding) {
	
    if (typeof (encoding) === 'undefined') {
        encoding = 'utf8';
    }
    var file = fs.readFileSync(filepath, encoding);
	
    return JSON.parse(file);
}


/*
 * 
 */
exports.index = function(req, res){
  res.json(readJsonFileSync("./kategorien.json", "utf-8"));
};

exports.new = function(req, res){
  res.send('not in use');
};

exports.create = function(req, res){
  res.send('not in use');
};

exports.show = function(req, res){
  res.send('not in use');
};

exports.edit = function(req, res){
  res.send('not in use');
};

exports.update = function(req, res){
  res.send('not in use');
};

exports.destroy = function(req, res){
  res.send('not in use');
};